echo "Start to generate nodejs,ts from thrift interface define."

CURRENT_DIR=$(cd $(dirname $0); pwd)
echo $CURRENT_DIR
for file_name in $(ls *)
do
  if [[ $file_name == *".thrift" ]]
  then
    chmod 755 $file_name
    thrift --gen js:node,ts $file_name
    echo thrift --gen js:node,ts $file_name
  fi
done
echo "Finish thrift definition generation"
sleep 10